package com.abso.sunlight.explorer;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;

/**
 * Bundle of all images contributed by the Sunlight UI plug-in.
 */
public enum SunlightImages {

    CONTACT("icons/full/obj16/contact_obj.gif"), LEGISLATOR("icons/full/obj16/legislator_obj.gif"), LEGISLATOR_SEARCH(
            "icons/full/obj16/legislator_search_obj.gif"), LEGISLATORS("icons/full/obj16/legislators_obj.gif"), LOCATION(
            "icons/full/obj16/location_obj.gif"), GENERAL("icons/full/obj16/general_obj.gif"), NEW_SEARCH(
            "icons/full/elcl16/new_search.gif"), SAVE_WIZ("icons/full/wizban/save_wiz.gif");

    /** The plug-in relative path. */
    private String path;

    /**
     * Constructs a new image.
     * 
     * @param path   the plug-in relative path.
     */
    SunlightImages(String path) {
        this.path = path;
    }

    /**
     * Returns the plug-in relative path.
     * 
     * @return   the plug-in relative path.
     */
    public String getPath() {
        return path;
    }

    /**
     * Gets the image with the specified key.
     * 
     * @param key
     *            an image key.
     * @return the image with the specified key.
     */
    public Image get() {
        return CongressExplorerPlugin.getDefault().getImageRegistry().get(toString());
    }

    /**
     * Gets the image descriptor with the specified key.
     * 
     * @param key
     *            an image key.
     * @return the image descriptor with the specified key.
     */
    public ImageDescriptor getDescriptor() {
        return CongressExplorerPlugin.getDefault().getImageRegistry().getDescriptor(toString());
    }

}